package com.task.dao.impl;

import org.hibernate.Query;
import org.hibernate.Session;

import com.task.common.BaseHibernateDao;
import com.task.dao.UserDao;
import com.task.entity.User;

public class UserDaoImpl extends BaseHibernateDao<User> implements UserDao {

	public User checkLogin(User user) {
		Session session=super.getSession();
		String hql="select user from User user where user.userName=:name and user.userPass=:pass";
		Query query=session.createQuery(hql);
		query.setString("name", user.getUserName());
		query.setString("pass", user.getUserPass());
		return (User) query.uniqueResult();
	}

}
